package com.zhong.genericity;


import org.junit.Test;

import java.util.Iterator;
import java.util.Map;

/**
 * @author:yanglin on 2018/6/17.
 */

public class MapUtils {
    /** 遍历 */
    public <K,V> void byInterator(Map<K, V> map){
        Iterator<Map.Entry<K, V>> iterator = map.entrySet().iterator();
        while (iterator.hasNext()){
            Map.Entry<K, V> next = iterator.next();
            System.err.println("key: " + next.getKey() + "  value: " +next.getValue());
        }
    }
}
